import { Field, Int, ObjectType } from "@nestjs/graphql";
import { BaseEntity } from "../base.entity/base.entity";
import { Department } from "@prisma/client";
import { CollegeEntity } from "../college.entity/college.entity";
import { ScienceEntity } from "../science.entity/science.entity";

@ObjectType()
export class DepartmentEntity extends BaseEntity implements Department {
    hash: string;
    
    @Field()
    name: string;

    @Field(() => Int, { nullable: true })
    collegeId: number;

    @Field(() => CollegeEntity, { nullable: true })
    college?: CollegeEntity

    @Field(() => [ScienceEntity], { nullable: true })
    Science?: ScienceEntity[]
}
